<!DOCTYPE html>
<html><head>
	<meta charset="UTF-8">
	<title>コントロールパネル</title>
    <link href="./assets/styles/default.css" rel="stylesheet" />
	<script src="./assets/scripts/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
	<script src="./assets/scripts/plugins/password_strength_plugin.js" type="text/javascript"></script>
	<script src="./assets/scripts/import.js" type="text/javascript"></script>
	<script src="./assets/scripts/plugins/zip2address.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(function(){			
			$("#text_auth_pwd").passStrength({
				userid:			"#url",	//required override text_auth_user
				messageloc:		1			//before == 0 or after == 1
			});
		});
	</script>
</head>
<body>

{{$zhead}}

<div id="container">
{{$zmenu}}
    
    <article>
    	<h2><span>&nbsp;</span>会員管理<p><a href="javascript:;">Open Plugins</a></p></h2>
        <nav>
        	<ul>
				<li><a href="Home_User_index.html"><span>会員検索</span></a></li>
				<li class="active"><a href="user_regist.php"><span>会員登録</span></a></li>
			</ul>
        </nav>
		<section id="content">
			<h3>会員登録</h3>
			{{if $show_massg}}
			
			<form name="fm" action="Home_User_regist.html" method="post" enctype="multipart/form-data">
				<h4><span>&nbsp;</span>基本情報</h4>
				<table class="formTable">
					<tbody>
						<tr>
							<th class="must1">状態</th>
							<td>
								<label><input type="radio" name="state" {{if $forms.state==1}}checked=true{{/if}} value="1" />通常</label>
								<label><input type="radio" name="state" {{if $forms.state==2}}checked=true{{/if}} value="2" />仮登録</label>
								<label><input type="radio" name="state" {{if $forms.state==3}}checked=true{{/if}} value="3" />退会</label>
							{{ $err.state }}
							</td>
						</tr>
						<tr>
							<th class="must1">ID</th>
							<td>
							<input type="text" name="login_id" value="{{$forms.login_id |escape}}" maxlangth="20"/>
							{{ $err.login_id }}{{ $err.login_id2 }}</td>
						</tr>
						<tr>
							<th class="must1">パスワード</th>
							<td>
								<input type="text" name="login_pwd" class="text" value="{{$forms.login_pwd |escape}}" />
								{{ $err.login_pwd }}
							</td>
						</tr>
						<tr>
							<th class="must1">会員氏名</th>
							<td>
								<input type="text" class="short" name="user_name1" value="{{$forms.user_name1}}" />
								<input type="text" class="short" name="user_name2" value="{{$forms.user_name2}}" />
								{{$err.user_name1}}
								{{$err.user_name2}}
							</td>
						</tr>
						<tr>
							<th class="must1">フリガナ</th>
							<td>
								<input type="text" class="short" name="user_name_furikana1" value="{{$forms.user_name_furikana1}}" />
								<input type="text" class="short" name="user_name_furikana2" value="{{$forms.user_name_furikana2}}" />
								{{$err.user_name_furikana1}}
								{{$err.user_name_furikana2}}
							</td>
						</tr>
						<tr>
							<th>貴医院名・貴技工所名</th>
							<td>
								<input type="text" class="text" name="workshop_name" value="{{$forms.workshop_name}}" />{{ $err.workshop_name }}
							</td>
						</tr>
						<tr>
							<th>フリガナ</th>
							<td>
								<input type="text" class="text" name="workshop_name_furikana" value="{{$forms.workshop_name_furikana}}" />{{ $err.workshop_name_furikana }}
							</td>
						</tr>
						<tr>
							<th class="must1">郵便番号</th>
							<td class="floats">
								<input type="text" name="zipcode1" class="short" value="{{$forms.zipcode1}}" />
								<span> - </span>
								<input type="text" name="zipcode2" class="short" value="{{$forms.zipcode2}}" />
								<span class="btn_blank">
								<a href="javascript:;" style="position:relative;top:-2px;" class="searchAddress">住所検索</a>
								</span>
								{{ $err.zipcode }}
								{{ $err.zipcode1 }}
								{{ $err.zipcode2 }}
							</td>
						</tr>
						<tr>
							<th class="must1">都道府県</th>
							<td>
						<select name="local_cd" id='select_id'>
	                       {{html_options options=$dao_local selected=$forms.local_name}}
                        </select>
                         {{ $err.local_cd }}
							</td>
						</tr>
						<tr>
							<th class="must1">市区町村</th>
							<td>
								<input type="text" name="treet_name" id="treet_name"  class="text" value="{{$forms.treet_name}}" />
							{{ $err.treet_name }}
							</td>
						</tr>
						<tr>
							<th class="must1">以降の住所</th>
							<td>
							<input type="text" name="address" class="text" value="{{$forms.address}}" />
							{{ $err.address }}
							</td>
						</tr>
						<tr>
							<th class="must1">電話番号</th>
							<td>
								<input type="text" class="short" name="tel_number1" value="{{$forms.tel_number1}}" /> - 
								<input type="text" class="short" name="tel_number2" value="{{$forms.tel_number2}}" /> - 
								<input type="text" class="short" name="tel_number3" value="{{$forms.tel_number3}}" />
								{{ $err.tel_number }}
								{{ $err.tel_number1 }}
								{{ $err.tel_number2 }}
								{{ $err.tel_number3 }}
							</td>
						</tr>
						<tr>
							<th>FAX番号</th>
							<td>
								<input type="text" class="short" name="mobile_number1" value="{{$forms.mobile_number1}}" /> - 
								<input type="text" class="short" name="mobile_number2" value="{{$forms.mobile_number2}}" /> - 
								<input type="text" class="short" name="mobile_number3" value="{{$forms.mobile_number3}}" />
							</td>
						</tr>
						<tr>
							<th class="must1">E-Mail</th>
							<td><input type="text" name="email" id="email" class="text" value="{{$forms.email}}" />
							{{ $err.email }}
							</td>
						</tr>
						<tr>
							<th>メルマガ購読（PC）</th>
							<td><label><input type="checkbox" name="send" {{if $forms.send==1}}checked="true"{{/if}} value="1" />購読する</label></td>
						</tr>
						<tr>
						<tr>
							<th>生年月</th>
							<td class="floats">
				        {{ html_options id='year4' name='year4' options=$year4 selected=$forms.birthday_year}}
						{{ html_options id='moon4' name='moon4' options=$moon4 selected=$forms.birthday_m}}	
							</td>
						</tr>
						<tr>
							<th>性別</th>
							<td>
								<label><input type="radio" name="sex" {{if $forms.sex==1}}checked=true{{/if}} value="1" />女性</label>
								<label><input type="radio" name="sex" {{if $forms.sex==2}}checked=true{{/if}} value="2" />男性</label>
								<label><input type="radio" name="sex" {{if $forms.sex==3}}checked=true{{/if}} value="3" />指定なし</label>
							</td>
						</tr>
					</tbody>
				</table>
				
				<p class="button">
					<button type="submit" id="btn_update" class="submit"><span>登録</span></button>
				</p>
			</form>
		
		{{else}}
			<p class="message">{{$message}}</p>
			
			
			<ul class="result_btn clear" style="margin-top:20px;">
                <li><a href="{{'Home/User/index'|U}}">一覧に戻る</a></li>
                <li><a href="{{'Home/User/insert'|U}}">続けて新規登録する</a></li>
            {{if isset($forms.id)}}
                <li><a href="{{'Home/User/update'|U}}?id={{$forms.id}}">登録した内容を更新する</a></li>
            {{/if}}
        	</ul>
			
		{{/if}}
		
		
		</section>
	</article>
</div><script type="text/javascript">
		$(function(){
	//search address
		$('.searchAddress').live('click',function(){
			var p = $(this).closest("td");
			var table = $(this).closest("table");
			var post1 = $('input[name=zipcode1]').val();
			var post2 = $('input[name=zipcode2]').val();
			if(post1 == "" || post2 == ""){return;}
			var post = post1 +""+ post2;
			zip2address(post, function(address) {
			if (address) {
				$("#treet_name").val(address.city);
				$("#uniform-select_id>span").text(address.pref);
				//$("#select_id ").val(address.index);
				$("#select_id").children().attr("selected",false);
				  $("#select_id").find("option[value='"+(address.index+1)+"']").attr("selected",true);
		
				
			}
			else {
				alert("見つかりませんでした。。\n入力した郵便番号に誤りがないか、お確かめ下さい。");
			}
		});
			
		});
		});
</script>
<footer id="dashboard_footer">Copyright (C) SHIFT. / All rights reserved.</footer>
</body>
</html>